package eu.dominicum.ft.pd.boundary;

import eu.dominicum.ft.pd.FantasyTour;
import eu.dominicum.ft.pd.Participant;
import eu.dominicum.ft.pd.StageResult;
import eu.dominicum.ft.pd.TeamMember;
import eu.dominicum.ft.pd.mao.AssociateLocationsWithStageMAO;
import eu.dominicum.ft.pd.mao.AssociateTeamMemberByYerseyNumberMAO;
import eu.dominicum.ft.pd.mao.MakeFantasyTourMAO;
import eu.dominicum.ft.pd.mao.MakeParticipantMAO;
import eu.dominicum.ft.pd.mao.MakeStageResultMAO;
import eu.dominicum.ft.pd.mao.validator.AssociateRiderWithTeamMemberMAO;

import java.util.List;
import java.util.Vector;

/**
 * Boundary interface for the {@link FantasyTour} object.
 *
 * @author Harry Klerks
 * @since 2013M1
 */
public interface FantasyTourManagement {

    /**
     * Returns a list of all {@link FantasyTour} objects in the repository.
     *
     * @return List<FantasyTour>
     */
    List<FantasyTour> findAllFantasyTours();

    /**
     * See {@link FantasyTour#make(eu.dominicum.ft.pd.mao.MakeFantasyTourMAO)}.
     *
     * @param mao -
     * @return FantasyTour
     */
    FantasyTour makeFantasyTour(MakeFantasyTourMAO mao);

    /**
     * Returns the {@link FantasyTour} object identified by the given id.
     *
     * @param fantasyTourId -
     * @return FantasyTour
     */
    FantasyTour findById(Long fantasyTourId);

    /**
     * See .
     *
     * @param makeParticipantMAO -
     * @return Participant
     */
    Participant makeParticipant(MakeParticipantMAO makeParticipantMAO);

    /**
     * Finds all Team Members in the given Tour.
     *
     * @param tourId -
     * @return List<TeamMember>
     */
    List<TeamMember> findAllTeamMembers(Long tourId);

    /**
     * See {@link FantasyTour#associateTeamMemberByYerseyNumber(eu.dominicum.ft.pd.mao.AssociateTeamMemberByYerseyNumberMAO)}.
     *
     * @param associateTeamMemberByYerseyNumberMAO
     *         -
     */
    void associateTeamMemberByYerseyNumber(AssociateTeamMemberByYerseyNumberMAO associateTeamMemberByYerseyNumberMAO);

    /**
     * See {@link StageResult#make(eu.dominicum.ft.pd.mao.MakeStageResultMAO)}.
     *
     * @param makeStageResultMAO -
     * @return StageResult
     */
    StageResult makeStageResult(MakeStageResultMAO makeStageResultMAO);

    /**
     * (Re)calculate all scores for a given {@link eu.dominicum.ft.pd.FantasyStage} object.
     *
     * @param fantasyStageId -
     */
    void calculateScoresForStage(Long fantasyStageId);

    /**
     * Calculates the overall rankings for the given fantasy tour id.
     *
     * @param fantasyTourId -
     * @return Vector
     */
    Vector calculateOverallRankings(Long fantasyTourId);

    /**
     * Calculates the points rankings for the given fantasy tour id.
     *
     * @param fantasyTourId -
     * @return Vector
     */
    Vector calculatePointsRankings(Long fantasyTourId);

    /**
     * Calculates the climbing rankings for the given fantasy tour id.
     *
     * @param fantasyTourId -
     * @return Vector
     */
    Vector calculateClimbingRankings(Long fantasyTourId);

    /**
     * Calculates the youth rankings for the given fantasy tour id.
     *
     * @param fantasyTourId -
     * @return Vector
     */
    Vector calculateYouthRankings(Long fantasyTourId);

    /**
     * Reveal the real name of the {@link Participant} identified by the given IDs.
     *
     * @param fantasyTourId -
     * @param participantId -
     */
    void revealParticpantRealName(Long fantasyTourId, Long participantId);

    /**
     * Associate a rider with a team member.
     *
     * @param associateRiderWithTeamMemberMAO
     *         -
     */
    void associateRiderWithTeamMember(AssociateRiderWithTeamMemberMAO associateRiderWithTeamMemberMAO);

    /**
     * Associate the given location(s) with the given stage in the given fantasy tour.
     *
     * @param associateLocationsWithStageMAO -
     */
    void associateLocationsWithStage(AssociateLocationsWithStageMAO associateLocationsWithStageMAO);

    /**
     * Calculates all totals for the given Fantasy Tour.
     *
     * @param selectedFantasyTour -
     * @param stageFilter         -
     * @return Vector
     */
    Vector calculateTotalRankings(Long selectedFantasyTour, Long stageFilter);

    /**
     * Calculats and sets the fantasy team that will yield maximum points in the total rankings.
     *
     * @param selectedFantasyTour -
     * @param participantId       -
     */
    void calculateIdealTeam(Long selectedFantasyTour, Long participantId);
}
